<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

	<h:head>
		<title>Employee Contact Information - v2</title>
		<link rel="stylesheet" type="text/css" href="../../08/css/styles.css" />
	</h:head> 
	<h:body> 
		<div align="center">
			<table border="5">
				<tr>
					<th>Employee Contact Information</th>
				</tr>
			</table>
		</div>
		
		<p/>
		
		<fieldset>
			<legend>Please fill the form: </legend>
			<h:form>
				<table>
					<tr>
						<td>First Name: 
							<h:inputText value="#{employee.firstName}" required="true" requiredMessage="Please enter your first name" id="firstNameID" >
								<f:validateLength minimum="2"/>
							</h:inputText>
						</td>
						<td>
							<h:message for="firstNameID"/>
						</td>
					</tr>
					<tr>
						<td>Middle name: 
							<h:inputText value="#{employee.middleName}" requiredMessage="Please enter your middle name" id="middleNameID"/>
						</td>
						<td>
							<h:message for="middleNameID"/>
						</td>
					</tr>
					<tr>
						<td>Last Name: 
							<h:inputText value="#{employee.lastName}" required="true" requiredMessage="Please enter your last name" id="lastNameID">
								<f:validateLength minimum="3"/>
							</h:inputText>
						</td>
						<td>
							<h:message for="lastNameID"/>
						</td>
					</tr>
					<tr>
						<td>Employee ID: 
							<h:inputText value="#{employee.employeeID}" required="true" requiredMessage="Please enter your Employee ID" id="employeeIdID" >
								<f:validateRegex pattern="[a-z]{1}[0-9]{4}" />
							</h:inputText>
						</td>
						<td>
							<h:message for="employeeIdID"/>
						</td>
					</tr>
					<tr>
						<td>Building number: 
							<h:inputText value="#{employee.buildingNumber}" required="true" requiredMessage="Please enter the building number" converterMessage="Building number must be a number" id="buildingNumberID" validatorMessage="Sólo están disponibles oficinas de 1 hasta 50">
								<f:validateLongRange minimum="1" maximum="50"/>
							</h:inputText>
						</td>
						<td>
							<h:message for="buildingNumberID"/>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<h:commandButton value="Send" action="#{employee.doPost}" />
						</td>
					</tr>
				</table>
			</h:form>
		</fieldset>
		
	</h:body> 
</html>
